package com.qys.livesMall.system.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.qys.livesMall.common.exception.QysException;
import com.qys.livesMall.system.mapper.WalletMapper;
import com.qys.livesMall.system.modal.entity.Wallet;
import com.qys.livesMall.system.service.WalletService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 钱包表(Wallet)表服务实现类
 *
 * @author makejava
 * @since 2023-07-07 17:38:19
 */
@Service("walletService")
public class WalletServiceImpl extends ServiceImpl<WalletMapper, Wallet> implements WalletService {


    @Override
    public void removeWallet(List<Long> idList) {
        Long count = baseMapper.getWalleSubordinate(idList,1);
        if(count > 0){
            throw new QysException("wallet in use");
        }
        baseMapper.deleteBatchIds(idList);
    }
}

